snapshot: scale border widths when appending border nodes
authorBenjamin Otte <otte@redhat.com>
Thu, 1 Apr 2021 14:20:32 +0000 (16:20 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 1 Apr 2021 14:37:43 +0000 (16:37 +0200)
Found by Matthias on IRC while arguing about GtkSnapshot being too
complicated.

gtk/gtksnapshot.c

index e118031192355bb13d21f50e4171151903bbbd57..577565d21a22807d0f21310c2a7bdbde5c54ab78 100644 (file)
@@ -2448,7 +2448,14 @@ gtk_snapshot_append_border (GtkSnapshot          *snapshot,
   gtk_snapshot_ensure_affine (snapshot, &scale_x, &scale_y, &dx, &dy);
   gsk_rounded_rect_scale_affine (&real_outline, outline, scale_x, scale_y, dx, dy);
 
-  node = gsk_border_node_new (&real_outline, border_width, border_color);
+  node = gsk_border_node_new (&real_outline,
+                              (float[4]) { 
+                                border_width[0] * scale_y,
+                                border_width[1] * scale_x,
+                                border_width[2] * scale_y,
+                                border_width[3] * scale_x,
+                              },
+                              border_color);
 
   gtk_snapshot_append_node_internal (snapshot, node);
 }